package com.chenjf.controller;

import com.chenjf.feign.StudentFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("teacher")
public class TeacherController {

    @Autowired
    private StudentFeign studentFeign;

    @GetMapping("test")
    public String test() {
        System.out.println("teacher ok");
        //调用student的方法
        studentFeign.list(1);
        return "teacher ok!";
    }

    public TeacherController(StudentFeign studentFeign) {
        this.studentFeign = studentFeign;
    }
}
